//
//  NewOrderDetailFooterView.m
//  NewPro
//
//  Created by RYX on 2019/5/28.
//  Copyright © 2019 何荧红. All rights reserved.
//

#import "NewOrderDetailFooterView.h"
#import "OrderDetailModel.h"

@interface NewOrderDetailFooterView ()

@property (nonatomic,strong) UIView *xibView;


@end

@implementation NewOrderDetailFooterView

- (UIView *)xibView{
    
    if (!_xibView) {
        
        _xibView = [[[NSBundle mainBundle] loadNibNamed:@"NewOrderDetailFooterView" owner:self options:nil] objectAtIndex:0];
    }
    
    return _xibView;
}
    
- (instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        
        [self setUI:frame];
    }
    
    return self;
}
    
- (void)setUI:(CGRect)frame{
    
    [self addSubview:self.xibView];
    
    self.xibView.frame = frame;
    
}

- (void)setModel:(OrderDetailModel *)model{
    
    self.numLa.text = [NSString stringWithFormat:@"%@台",model.activeCount];
    
    if (model.proportion >= 70 ) {

        if ([model.orderStatus intValue] == 2) {
            self.blLa.text = [NSString stringWithFormat:@"%.2f%%(已完成,待发货)",model.proportion];
        }else{
            
            self.blLa.text = [NSString stringWithFormat:@"%.2f%%",model.proportion];
        }
    }else{

        self.blLa.text = [NSString stringWithFormat:@"%.2f%%(未完成)",model.proportion];
    }
}
@end
